package dfsketches.gr3d;

import dfsketches.visualizer_2d.ColorSolver;

public class TerrainColorSolver implements ColorSolver {

	@Override
	public int getColor(int value) {
		if (value < -250) {
			value = -250 & 0x000000FF;
		} else if (value < 0) {
			value = (value) & 0x000000FF;
		} else if (value < 5) {
			value = ((value+150) * 0x00010100) & 0x00FFFF00;
		} else if (value < 150) {
			value = ((value+50) * 0x00000100) & 0x0000FF00;
		} else if (value < 250) {
			value = (value * 0x00010101) & 0x00FFFFFF;
		} else {
			value = 250 * 0x00010101;
		}
		return value | 0xFF000000;
	}

}
